package cn.maven.main;

import freemarker.template.TemplateException;

import java.io.File;
import java.io.IOException;

public class MainHandler {
    public static boolean createDir(String destDirName){
        File dir=new File(destDirName);
        if(dir.exists()){
            System.out.println("创建目录"+destDirName+"失败，目标目录已经存在");
            return false;
        }
        if(!destDirName.endsWith(File.separator)){
            destDirName=destDirName+File.separator;
        }
        //创建目录
        if(dir.mkdirs()){
            System.out.println("创建目录"+destDirName+"成功！");
            return true;
        }else{
            System.out.println("创建目录"+destDirName+"失败！");
            return false;
        }
    }

    public static void main(String[] args) throws IOException, TemplateException {
        EntityHandler entityHandler = new EntityHandler();
        entityHandler.exectue();
        System.out.println("完成实体类");
        MapperHandler mapperHandler = new MapperHandler();
        mapperHandler.exectue();
        System.out.println("完成mapper层");
        ServiceHandler serviceHandler = new ServiceHandler();
        serviceHandler.exectue();
        System.out.println("完成service层");
        ControllerHandler controllerHandler = new ControllerHandler();
        controllerHandler.exectue();
        System.out.println("完成控制层");
        ListHandler listHandler = new ListHandler();
        listHandler.exectue();
        AddHandler addHandler = new AddHandler();
        addHandler.exectue();
        System.out.println("完成html层");
        ListJsHandler listJsHandler = new ListJsHandler();
        listJsHandler.exectue();
        AddJsHandler addJsHandler = new AddJsHandler();
        addJsHandler.exectue();
        System.out.println("完成js层");
    }
}
